1. Field of the Invention
The present invention relates to an image compensation method and more particularly to an image noise compensation method applicable to a digital image with noises generated by Bayer pattern color processing.
2. Related Art
In a photosensitive element, an array formed by millions of photosensitive units (or pixels) covers a surface of a transducer. Once the photosensitive element receives lights, accumulated charges on the pixel array of the entire photosensitive element are read from one end of the photosensitive element. The accumulated charges are quantified by an analog front end (AFE) chip or a photosensitive processor.
In order to precisely present a color image, each pixel position on the transducer requires three color samples, which are normally three primary colors of red, green, and blue (RGB). However, if three layers of color photosensitive elements are disposed on the same pixel position, the cost of a digital camera may be greatly increased. Therefore, a process of using a color filter array (CFA) to receive lights for the color pixels has been proposed. Currently, the most commonly used CFA is a Bayer pattern.
FIG. 1 is a schematic view of a Bayer pattern. Referring to FIG. 1, a Bayer pattern 100 utilizes the principle that human eyes are more sensitive in recognizing green than in recognizing red or blue. Therefore, in a CFA with the Bayer pattern 100, the number of green filters is twice of that of blue filters or red filters, such that each four pixels form one unit. The arrangement sequences of the filters are as follows: in the first row, red filters and green filters are arranged alternately; and in the next row, green filters and blue filters are arranged alternately.
Finally, a digital camera processor performs a color interpolation according to the quantity of lights received by each pixel. Table 1 shows a partial list of a filter array of pixels.
TABLE 1G1R2G3R4B5G6B7G8G9R10G11R12B13G14B15G16
For example, the interpolation operation is an interpolation of green pixels at positions of blue pixels and red pixels. Referring to Table 1, as four surrounding pixels all have real green pixels, a missing green pixel can be recovered through interpolation by using the surrounding green pixels. Likewise, a missing red pixel or a missing blue pixel can also be recovered through interpolation by using the same color in neighboring regions thereof.G′7=(G3+G6+G8+G11)/4R′7=(R2+R4+R10+R12)/4B′6=(B5+B7)/2
Here, G, R, and B respectively represent a real green pixel, a real red pixel, and a real blue pixel, and G′, R′, and B′ respectively represent a green pixel value, a red pixel value, and a blue pixel value obtained through interpolation.
After the colors of the above pixels are reconfigured, color correction values of all pixels in the Bayer pattern 100 may be obtained. After compensation, Table 2 is obtained as follows, which shows a list of colors of each pixel after compensation.
TABLE 2G1 R′1 B′1G′2R2 B′2G3R′3 B′3G′4R4B′4G′5R′5B5G6 R′6B′6G′7 R′7B7G8R′8B′8G9R′9B′9G′10R10 B′10G11R′11B′11G′12R12B′12G′13R′13B13G14R′14B′14G′15R′15B15G16R′16B′16
However, if merely a single color is used for compensation and correction, distant color pixels may severely affect the current color pixel. In other words, as not all pixels of the Bayer pattern 100 in the digital image are similar, neighboring pixels with significant differences may affect an overall average. At this time, noises are generated in the digital image.
If a noise removal process is performed on each compensated pixel, the effect of the noise removal is rather limited, as the pixel has been compensated by other colors.